<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>Processing.js test of xmlElement getChild(), getAttributeCount(), removeAttribute()</title>
	<script type="text/javascript" src="../../../processing.js"></script> 

</head>
<body>


	<script id="script" type="application/processing">
    XMLElement xml;
    XMLAttribute atrib;
    void setup() {
      size(200, 200);
      xml = new XMLElement(this, "sites.xml");
      xml.setAttribute("width", "100");
      xml.setAttribute("height","100");
      println("adding width and height attribute");
      println("xml.getAttributeCount:" +xml.getAttributeCount());
      xml.setAttribute("height","200");
      println("this element have the attribute width:" +xml.hasAttribute("width"));
      println("this element have the attribute height:" +xml.hasAttribute("height"));
      println("this element have the attribute style:" +xml.hasAttribute("style"));
    }

	</script>
<h1>XMLElement Test5: setAttribute(), getAttributeCount(), hasAttribute()</h1>
<h3>Source</h3><pre>
// The following short XML file called "sites.xml" is parsed 
// in the code below. It must be in the project's "data" directory
//&lt;?xml version="1.0"?&gt; 
// &lt;websites&gt; 
//   &lt;site id="0" url="processing.org"&gt; Processing&lt;/site&gt; 
//   &lt;site id="1" url="mobile.processing.org"&gt; Processing Mobile&lt;/site&gt; 
// &lt;/websites&gt; 

XMLElement xml;
XMLAttribute atrib;
void setup() {
  size(200, 200);
  xml = new XMLElement(this, "sites.xml");
  xml.setAttribute("width", "100");
  xml.setAttribute("height","100");
  println("adding width and height attribute");
  println("xml.getAttributeCount:" +xml.getAttributeCount());
  xml.setAttribute("height","200");
  println("this element have the attribute width:" +xml.hasAttribute("width"));
  println("this element have the attribute height:" +xml.hasAttribute("height"));
  println("this element have the attribute style:" +xml.hasAttribute("style"));
}
</pre>
<canvas id="display" style="width:10;height:10;"></canvas>
</body>
</html>

